﻿using PersonalWebsite.Core.CQRS;
using PersonalWebsite.Core.Result;

namespace PersonalWebsite.Application.Queries.Website;

public record GetAdminInfoVO
{
    public int Id { get; init; }
    public string[] Skills { get; init; }
    public string Desc { get; init; }
}

public class GetAdminInfoQuery : IQuery<ApiResult<GetAdminInfoVO>, GetAdminInfoVO>
{
}

internal sealed class GetAdminInfoQueryHandler : QueryHandler<GetAdminInfoQuery, ApiResult<GetAdminInfoVO>, GetAdminInfoVO>
{
    public GetAdminInfoQueryHandler(IDBConnectionFactory dBConnectionFactory) : base(dBConnectionFactory)
    {
    }

    public override async Task<ApiResult<GetAdminInfoVO>> Handle(GetAdminInfoQuery request, CancellationToken cancellationToken)
    {
        var result = new GetAdminInfoVO()
        {
            Id = 1,
            Skills = ["NetCore", "MySql", "SqlServer", "RabbitMq", "Redis", "Dapper", "EF", "Docker", "Linux", "Jenkins", "Nginx", "Wpf", "Prism", "MVC", "WebApi","JS" ,"JQuery", "Vue", "TypeScript", "Pinia", "Python"],
            Desc = "一名 .NET Core 后端开发工程师，能够依据项目需求快速搭建可靠的后端框架。熟悉 WebApi、MVC，了解多种关系型和非关系型数据库，如 SQLServer、MySQL、Redis等；熟悉消息中间件 RabbitMQ，熟练掌握 WPF 桌面应用开发及 Prism MVVM 框架；掌握跨平台技术、容器技术，熟悉 Linux 系统；熟悉前端 JS、jQ、Vue 以及TypeScript 等技术。同时熟悉部分工业通信协议，如 Modbus、PLC 等。熟悉Python对爬虫、AI智能体有一定的了解。"
        };

        return await Task.FromResult(ApiResult<GetAdminInfoVO>.Success(result));
    }
}